﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AreaRules_Edit.aspx.cs"
    Inherits="Catering.Catering_Page.system.AreaRules_Edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Style/center.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/zhezhao.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <link href="../../Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <link href="../../Style/sysData.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .raw_list
        {
            width:800px; height:300px; overflow-y:auto;
        }
        a
        {
            text-decoration: none;
        }
        
        .raw_dl{}
        .raw_dt{ clear:both; width:800; height:30px; line-height:30px; color:#ffffff; border:1px solid #044E94; margin:2px; background-color:#6CB9EA;}
        .raw_dd{ float:left; white-space:nowrap; padding:2px 3px; border:1px solid #293955; margin:2px; background-color:#EBF5FE;}
        .raw_dt input{ vertical-align:middle;}
        .raw_dd input{ vertical-align:middle;}
    </style>
    <script type="text/javascript">
        function SetCheckMore(obj,id) {            
            //全选、取消
            if ($(obj).is(":checked")) {
                $("input[name='Raw_" + id + "']").attr("checked", true);
            }
            else {
                $("input[name='Raw_" + id + "']").attr("checked", false);
            }
        }

        function CheckAReaRulesInfo() {
            var name = $("#txt_ARName").val();
            var areaid = $("#Drop_AreaID").val();
            var id = $("#HF_ARID").val();
            if (name == "") {
                alert("请输入规则名称！");
                return;
            }
            var stridlist = "";
            $("input[RAW='RawType']").each(function () {
                if (this.checked) {
                    stridlist += $(this).val() + ",";
                }
            });

            $.ajax({
                type: "Post",
                url: "AreaRules_Edit.aspx/btn_Save",
                data: "{'ARID':'" + id + "','ARName':'" + name + "','AreaID':'" + areaid + "','RawIDlist':'" + stridlist + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d[0] = "OK") {
                        alert("保存成功！");
                        window.location = 'AreaRules_Edit.aspx?ARID=' + data.d[1];
                    }
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="HidID" runat="server" />
    <div style="height: 36px; line-height: 36px; font-size: 13px;">
        &nbsp;当前位置：区域配送规则<%=m_States %></div>
    <%if (Catering.Toolss.IsVerification(Session["RoleID"].ToString(), "System_Data.aspx", "配送规则操作"))
      { %>
    <div class="btn_list" style="margin-top: 0px;">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    &nbsp;
                </td>
                <td width="100" align="right" height="28">
                    <a href="javascript:CheckAReaRulesInfo()" class="input_btn_a">保 存</a>
                </td>
                <td width="100" align="right" height="28">
                    <a href="AreaRules.aspx" class="input_btn_a">返 回</a>
                </td>
                <td width="10">
                </td>
            </tr>
        </table>
    </div>
    <%} %>
    <div>
        <table>
            <tr>
                <td>规则名称：</td>
                <td>
                    <asp:TextBox ID="txt_ARName" runat="server"></asp:TextBox>
                </td>
                <td>配送区域：</td>
                <td>
                    <asp:DropDownList ID="Drop_AreaID" runat="server"></asp:DropDownList>
                    <asp:HiddenField ID="HF_ARID" runat="server" Value="0" />
                </td>
            </tr>
        </table>
        <div id="RawNamesStr" class="raw_list" runat="server"></div>
    </div>
    </form>
</body>
</html>
